




'''
class Dog(object):
    def __init__(self,name):
        self.name = name
    def eat(self,food):
        print('%s is eating %s'%(self.name,food))
d = Dog('ouyang')
d.eat('豹子')
'''
#静态方法：只是名义上归类管理，实际上在静态方法里刚问不了类或实例中的任何属性
class Dog(object):

    def __init__(self,name):
        self.name = name
    @staticmethod   #静态方法，实际上跟类有什么关系
    def eat():
        print('%s is eating %s'%('wo','food'))
    @staticmethod
    def sleep(self):
        print('%s is sleeping' % self.name)
d = Dog('ouyang')
d.eat()
d.sleep(d)#把自己传进去

